<?php include './application/views/common/header.php'; ?>

<div class="gsdobj">
	<div class="gsdobj_title">
		<h2 style="margin-left:20px;line-height:60px;font-size:24px;"><?php echo $yjb['title'];?></h2>
	</div>
	<div class="gsdobj_wrap">
		<div class="gsdobj_wrap_left">
			<div class="gsdobj_list">
				<ul>
					<li><p>项目的总额（元）</p><em>&yen;<?php echo number_format($yjb['account'],0);?></em></li>
					<li><p>最低投标金额</p><em>&yen;<?php echo intval($yjb['lowest_account']);?></em></li>
					<li><p>还款方式</p><em>到期还本息</em></li>
				</ul>
			</div>
			
			<div class="gsdobj_li">
				<?php 
				$aprList = json_decode($yjb['apr_list'],true);
				foreach ($aprList as $k => $val){
				?>
				<div class="gsdobj_li_l">
					<ul>				
						<li style="width:200px;text-align:left; " ><dd >借款期限：</dd><dt><?php echo $val['time_limit'];?>天</dt></li>
						<li style="width:160px"><dd >年化收益率：</dd><dt><?php echo $val['apr'];?>%</dt></li>
					</ul>
				</div>
				<div class="gsdobj_li_r">
					<ul>
						<?php if ($k==0){?>
						<li style="text-align:left; background:url('/static/images/right.png') no-repeat scroll  transparent">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;免充值费</li>
						<?php }elseif ($k==1){?>
						<li style="text-align:left; background:url('/static/images/right.png') no-repeat scroll  transparent">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;免提现费</li>
						<?php }else{?>
						<li style="text-align:left; background:url('/static/images/right.png') no-repeat scroll  transparent">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;免管理费</li>
						<?php }?>
					
						<!-- <li><dd>投标奖励：</dd><dt><?php echo $val['award'];?>%</dt></li> -->
					</ul>
				</div>

				<?php }?>
				
			</div>
			
			<div class="gsdobj_xy">
				<ul>
					<li style="width:190px;text-align:left; "><dd>剩余金额：</dd><dt><?php echo $yjb['account']-$yjb['account_yes'];?>元</dt></li>
					<li><dd>当前进度：</dd><dt><div class="gsdyjb_safe_jd" title="<?php echo round(($yjb['account_yes']/$yjb['account']),4)*100;?>%"><div class="gsdyjb_safe_jd_hover" style="width:<?php echo round(($yjb['account_yes']/$yjb['account']),4)*100;?>%;"></div></div></dt></li>
				</ul>
			</div>
		</div>
		<div class="gsdobj_wrap_right">
			<iframe id="iframe" name="iframe" style="display:none;"></iframe>
			<form id="investFrom" action="/borrow/slinvest.html" method="post" target="iframe">
			<input type="hidden" name="id" id="id" value="<?php echo $yjb['id'];?>">
			<ul>
				<li><dd>可用余额：</dd><dd><em><?php echo number_format($user_account['use_money'],2);?></em>元</dd></li>
				<li><dd>投标金额：</dd><dd><input class="jeinput" id="account" type="text" name="account"></dd></li>
				<li><dd>投标期限：</dd>
					<dd>
						<select class="yzinput" id="time_limit" name="time_limit">
							<?php foreach ($aprList as $val){?>
							<option value="<?php echo $val['time_limit'];?>"><?php echo $val['time_limit'];?>天</option>
							<?php }?>
						</select>
					</dd>
				</li>
				<li><dd>支付密码：</dd><dd><input class="jeinput" id="paypassword" type="password" name="paypassword"></dd></li>
			</ul>
			
			<div class="gsdbaobao_hover">
			<?php if ($yjb['fstatus']==2){?>
				<a onclick="javascript:document.getElementById('investFrom').submit();" href="javascript:void(0);">立即投标</a>
			<?php }elseif ($yjb['fstatus']==3){?>
				<a href="javascript:void(0);">还款中</a>
			<?php }else{?>
				<a href="javascript:void(0);">已还完</a>
			<?php }?>
			</div>
			</form>
		</div>
	</div>
	<!-- GsdObj_Wrap End -->
</div>
<!-- GsdObj End -->
<div class="gsdobj">
	<div class="gsdobj_tab">
		<ul>
			<li id="li1" class="gsdobj_tab_hover" onclick="show(1);" style="cursor:pointer;">项目详情</li>
			<li id="li2" onclick="show(2);" style="cursor:pointer;">投标记录</li>
		</ul>
	</div>
	<div id="div1" class="gsdbb_list_wrap">
		<table width="95%" border="0" cellpadding="0" cellspacing="0" style="text-align:left;margin:0 auto;">
			<tbody>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>名称</span></td>
					<td style="padding-left:20px;"><?php echo $yjb['title'];?></td>
				</tr>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>项目介绍</span></td>
					<td style="padding-left:20px;font-size:12px;line-height:30px;"><?php echo nl2br($yjb['content']);?> </td>
				</tr>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>还款方式</span></td>
					<td style="padding-left:20px;">到期还本息</td>
				</tr>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>计息时间</span></td>
					<td style="padding-left:20px;">即投即计息</td>
				</tr>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>加入条件</span></td>
					<td style="padding-left:20px;">加入金额<?php echo $yjb['lowest_account'];?>元起，以<?php echo $yjb['one_account'];?>元为投资单位递增</td>
				</tr>
				
				<tr style="background: #fff;">
					<td style="background:#F2F2F2;text-align:center;width:120px;border-right:1px solid #dcdcdc;"><span>最高投资上限</span></td>
					<td style="padding-left:20px;"><?php echo $yjb['most_account']>0 ? $yjb['most_account'] : '无';?></td>
				</tr>

			</tbody>
		</table>
	</div>
	<div id="div2" class="gsdbb_list_wrap" style="display:none;">
		<table width="95%" border="0" cellspacing="0" cellpadding="0" style="margin:0 auto;">
			<tr>
				<td bgcolor="#f0f5f7">投资人</td>
				<td bgcolor="#f0f5f7">投资金额(￥) </td>
				<td bgcolor="#f0f5f7">期限</td>
				<td bgcolor="#f0f5f7">利率</td>
				<td bgcolor="#f0f5f7">加入时间</td>
				<td bgcolor="#f0f5f7">状态</td>
			</tr>
			<?php foreach($tender_list as $tender){?>
			<?php if ($tender['account']>0){?>
			<tr>
                <td><div class="font_lan"><a href="/user/other/<?php echo $tender['user_id'];?>" target="_blank"><?php echo $tender['username'];?></a></div></td>
                <td><div class="font_Orange"><?php echo number_format($tender['account'],2);?>元</div></td>
                <td><?php echo $tender['time_limit_day'];?>天</td>
                <td><?php echo $tender['apr'];?>%</td>
                <td><?php echo date('Y-m-d H:i:s',$tender['add_time']);?></td>
				<td><div class="font_lan">已通过</div></td>
				<!-- <td><div class="font_lan">--</div></td> -->
			</tr>
			<?php }?>
		    <?php }?>
			<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
		</table>
	</div>
</div>
<!-- GsdObj End -->
<script type="text/javascript">
function show(documentId){
	for(var i=1;i<5;i++){
		if(documentId==i){
			document.getElementById('div'+i).style.display='';
			document.getElementById('li'+i).className='gsdobj_tab_hover';
		}else{
			document.getElementById('div'+i).style.display='none';
			document.getElementById('li'+i).className='';
		}
	}
}
</script>
<?php include './application/views/common/footer.php'; ?>